A computing system often includes one or more programs running at all times. These programs use memory allocated therefor during execution. Prior to data being stored to disk or written to disk (e.g., permanently), data is often stored in a temporary allocated memory area. Recycling memory is critical for a computing system because it provides ways to dynamically allocate memory to a program upon request and free up memory for reuse when the memory space is no longer needed or used by the program. The job of fulfilling a memory allocation request includes locating a block of unused memory having a sufficient size for the allocation request. In an operating system, memory must be allocated to programs, and reused by other programs after it is no longer required by the previous program. Here, an operating system may pretend that a computer has more memory than it actually does, and also that each program has the memory all to itself. Application memory management involves supplying the memory needed for a program from available memory resources, and recycling the memory for reuse after it is no longer needed. Application programs often cannot predict in advance how much memory they are going to require, thus creating the need for memory to be available at all times.
Memory management may be used to combat a number of issues created during the temporary storage of data. Some potential issues include programs which continually allocate memory without ever giving up the memory even though the memory is no longer needed. Eventually, these programs run out of available memory (referred to as memory leak). As an example, a memory leak may occur when an object (e.g., from object-oriented programming) is stored in memory but cannot be accessed by running code. Another problem that may arise is external fragmentation. External fragmentation occurs when free memory is separated into small blocks and is interspersed inefficiently. The result is that, although free storage is available, it is unusable because it is divided into pieces that are too small individually to satisfy the demands of the application. Another problem occurs when memory has a poor locality of reference. Successive memory accesses are faster if they are to nearby memory locations, however, if memory used by a program is placed far apart from one another, performance problems may arise. To combat some of these issues, memory managers may reuse memory by cleaning up old memory that is no longer in use by a program.
Throughout the drawings and the detailed description, unless otherwise described, the same drawing reference numerals will be understood to refer to the same elements, features, and structures. The relative size and depiction of these elements may be exaggerated or adjusted for clarity, illustration, and/or convenience.